from django.template import Library

from django.conf import settings
from django.utils.html import escape as e

register = Library()

# ----------------------------------------------------------- #
def category_list():
    """Makes an unordered list of categories"""
    return { 'categories': Categories.objects.all().order_by('category') }
register.inclusion_tag('inclusions/category_list.html')(category_list)


# ----------------------------------------------------------- #
def link_changeset(changeset):
    """Link construction helper"""
    return settings.NIGHTLY['changeset_url'] % {'changeset':changeset}





# register all filters...
register.filter('link_changeset', link_changeset)


